/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package rad.Java.MotelPlus.Class;

import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import rad.Java.Common.Class.DefaultClass;
import rad.Java.Common.Class.IClass;

/**
 *
 * @author Renato ferreira dos santos
 */
public class AptType extends DefaultClass implements IClass{
    // <editor-fold defaultstate="collapsed" desc="Declaration of variables">
        private String _name;
	private String _short_name;
    // </editor-fold>

    public AptType()
    {
        _gsql.setTable("apt_type");
        _sequence = "apt_type_apt_type_id_seq";
    }

    // <editor-fold defaultstate="collapsed" desc="Declaration of methods Get and Set">
       public String getName() {
            return _name;
        }

        public void setName(String _name) {
            this._name = _name;
        }

        public String getShortName() {
            return _short_name;
        }

        public void setShortName(String _short_name) {
            this._short_name = _short_name;
        } 
    // </editor-fold>
        
    // <editor-fold defaultstate="collapsed" desc="Declaration of functions">
        public void clear() {
            _id             = "";
            _name           = "";
            _short_name     = "";
        }

        @Override
        public void get(ResultSet rs) {
        try {
            _id             = rs.getString("apt_type_id");
            _name           = rs.getString("apt_type_name");
            _short_name     = rs.getString("apt_type_short_name");
        } catch (SQLException ex) {
            Logger.getLogger(AptType.class.getName()).log(Level.SEVERE, null, ex);
        }
        }

        @Override
        public void setGsql() {
            _gsql.setValue( _id             , "apt_type_id");
            _gsql.setValue( _name           , "apt_type_name");
            _gsql.setValue( _short_name     , "apt_type_short_name");
        }
    // </editor-fold>
}
